using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace vlcplay.Converters
{
    public class BoolToAlignmentConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            bool isMaximized = (bool)value;
            int normal = int.TryParse(parameter?.ToString(), out var n) ? n : 5;
            return isMaximized ? new Thickness(0) : new Thickness(normal);
        }
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
            => throw new NotImplementedException();
    }
}